home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Original Code / Lines Curves and Area Fills / DashedEllipse / DashedEllipse.cs next >
Encoding:
Text File  |  2001-01-15  |  767 b   |  27 lines

  1. //--------------------------------------------
  2. // DashedEllipse.cs ⌐ 2001 by Charles Petzold
  3. //--------------------------------------------
  4. using System;
  5. using System.Drawing;
  6. using System.Windows.Forms;
  7.  
  8. class DashedEllipse: PrintableForm
  9. {
  10.      public new static void Main()
  11.      {
  12.           Application.Run(new DashedEllipse());
  13.      }
  14.      public DashedEllipse()
  15.      {
  16.           Text = "Dashed Ellipse Using DrawArc";
  17.      }
  18.      protected override void DoPage(Graphics grfx, Color clr, int cx, int cy)
  19.      {
  20.           Pen       pen  = new Pen(clr);
  21.           Rectangle rect = new Rectangle(0, 0, cx - 1, cy - 1);
  22.  
  23.           for (int iAngle = 0; iAngle < 360; iAngle += 15)
  24.                grfx.DrawArc(pen, rect, iAngle, 10);
  25.      }
  26. }
  27.